home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EuroCD 3
/
EuroCD 3.iso
/
Programming
/
Amos
/
AMOSList-0198
/
AMOSLIST
/
000014_amos-request@svcs1.digex.net_Mon Jan 5 17:31:27 1998.msg
< prev
next >
Wrap
Text File
|
1998-06-24
|
5KB
|
122 lines
>From amos-request@svcs1.digex.net Mon Jan 5 17:31:27 1998
Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
by pony-1.mail.digex.net (8.8.8/8.8.8) with ESMTP id RAA11030
for <mcox@access.digex.net>; Mon, 5 Jan 1998 17:31:27 -0500 (EST)
Received: (from daemon@localhost)
by svcs1.digex.net (8.8.5/8.8.5) id PAA17794
for amos-out; Mon, 5 Jan 1998 15:38:05 -0500 (EST)
Received: from pony-2.mail.digex.net (pony-2.mail.digex.net [204.91.241.6])
by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id PAA17791
for <amos-list@svcs1.digex.net>; Mon, 5 Jan 1998 15:38:04 -0500 (EST)
Received: from cgi.inet.tele.dk (cgi.inet.tele.dk [194.182.149.95])
by pony-2.mail.digex.net (8.8.8/8.8.8) with SMTP id PAA23357
for <amos-list@access.digex.net>; Mon, 5 Jan 1998 15:32:21 -0500 (EST)
Received: (qmail 20476 invoked from network); 5 Jan 1998 20:32:05 -0000
Received: from post8.tele.dk (194.239.134.172)
by cgi.inet.tele.dk with SMTP; 5 Jan 1998 20:32:05 -0000
Received: from post8.tele.dk ([194.239.180.38]) by post8.tele.dk
(Netscape Mail Server v2.02) with SMTP id AAA37816;
Mon, 5 Jan 1998 21:32:04 +0100
From: Jens Vang Petersen <top_cat@post8.tele.dk>
To: Timo Engman <timoeng@hem1.passagen.se>
CC: amos-list@access.digex.net
Date: Mon, 05 Jan 1998 21:24:05 +0100
Message-ID: <yam7309.251.1747895528@post8.tele.dk>
In-Reply-To: <199801022137.WAA20557@Grynet.passagen.se>
X-Mailer: YAM 1.3.4 [020] - Amiga Mailer by Marcel Beck
Subject: Re: New Extension
MIME-Version: 1.0
Content-Type: text/plain
Status: O
X-Status:
On 02-Jan-98, Timo Engman smashed the keyboard with:
>Hello.
>I'm Timo Engman, and programming a new extension - which is called
>"Second-Hand Extension", the current version is 0.01d6 but please, all
>AMOSPro users - mail me and let me hear if I may add new commands to this
>extension that the users want...For now, the extension have five commands
>:-) pretty lame. But I learning how to program the graphics...
>The extension uses slot 22 but mail me and I may change it to whatever.
>Check the aminet/dev/amos/ for this extension...later...
>Maybe I mail the .Lib file soon, to the Mailing List.
I've added your extension to the extensionlist at my site, if you'd like to
see what slots are used and for what you can always drop by :))
---
>A Problem 1: How to return a string from a routine (and change it's
>length) from it, the string is in the extension
>dc.w TheLength
>dc.b "TheString",0
>even
You need to ask for memory and then build the right structure, when looking
at the string the first 2 bytes (word) holds the length of the string, then
at the 3rd byte the string itselve starts. You can see this by trying to
define a string in AMOS and then do a Deek(Varptr(W$)-2), that'll return
the 'len'..
Here's a way to do it:
First you ask for the stringspace (needed length in both d3 & d0)
;Ask for string space...
and.w #$FFFE,d3 * Only EVEN!
addq.w #2,d3
Rjsr L_Demande
lea 2(a1,d3.w),a1
move.l a1,HiChaine(a5)
move.l a0,STa_d(pc) * Store adress
move.w d0,(a0)+ * Store length
Now the structure-adress of the new string is placed in a locale
data-area to be returned to the caller, and the room for the string
itselve is pointed by a0, be carefull not to swap these as they differs
by 2 bytes !!!!..
Then create the string with the first character starting in the adress
pointed by a0, and end your procedure with:
move.l STa_d(pc),d3 ;Stringadress
moveq.l #2,d2 ;Returning a string
rts
(Remeber to clean up the stack BEFORE you put this, I'd forgotten once,
and the same bug can be found in the IO_devices 2.0)
That should return the string to the caller..
---
>Problem 2: How to get a pointer from the extension in assembler,
>typically i want the pointer for a variable, same as Varptr(variable) and
>pointer for an array, same as Varptr(var(array))
I havn't got a clue, I've been looking for a solve for the same problem
some time. I think it's hidden somewhere in the include files that
comes with AMOSPro.. Unfortunaly they're not very well documented..
---
>Hope that all peoples understanding my bad english (I'm swedish)...And
>those people who don't like the assembler language.
And I'm danish, so that isn't much better :)
--
Happy greetings, Yours..
__________________________________________________________________________
/_ __/ __ / __ /\ ___\ __ \__ _\ aka. JENS VANG PETERSEN
/ / / /_/ / ____/ \ \___\ __ \ \ \ Nyvej 8, DK-4450 Jyderup, Denmark
/_/ /_____/_/ \_____\_\ \_\ \_\ top_cat@post8.tele.dk
--------------------------------------------------------------------------
http://home8.inet.tele.dk/top_cat/
-*- Home of 'The Ultimate Extension list' for AMOS TC & AMOS PRO -*-
-*- AMOS Ring - AMIGA Ring - AQUA Ring -*-
--------------------------------------------------------------------------
Foolproof operation = All parameters are hard coded.
--------------------------------------------------------------------------